<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="RetrospectiveNotes.aspx.cs" Inherits="RetrospectiveNotes" Title="Tackle - Retrospective Notes" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentHolder" runat="Server">
    <strong>Retrospective Notes<br />
    </strong>
    <br />
    <span style="font-size: 8pt">This page tracks the retrospective notes for a sprint.<br />
    </span>
    <br />
    <asp:UpdatePanel runat="server" ID="UPGridView" UpdateMode="Conditional">
        <ContentTemplate>
<TABLE style="WIDTH: 98%" cellSpacing=0 cellPadding=4><TBODY><TR><TD style="BORDER-RIGHT: silver 1px ridge; BORDER-TOP: silver 1px ridge; BORDER-LEFT: silver 1px ridge; BORDER-BOTTOM: silver 1px ridge" vAlign=top bgColor=#e3eaeb><SPAN style="FONT-SIZE: x-small">Sprint: </SPAN><asp:DropDownList id="ddSprintNames" runat="server" Font-Size="X-Small" OnSelectedIndexChanged="ddSprintNames_SelectedIndexChanged" DataValueField="SprintID" DataTextField="SprintName" DataSourceID="dsSprintNames" AutoPostBack="True" OnDataBound="ddSprintNames_DataBound">
                        </asp:DropDownList></TD></TR><TR><TD><asp:DetailsView id="dvRetrospectiveNotes" runat="server" ForeColor="#333333" Font-Size="X-Small" BorderWidth="1px" BorderStyle="Solid" BorderColor="Black" OnPreRender="dvRetrospectiveNotes_PreRender" DataSourceID="dsRetrospectiveNotes" DataKeyNames="SprintID,SprintRetrospectiveNotesID" AutoGenerateRows="False" Height="50px" GridLines="None" CellPadding="4">
<FooterStyle BackColor="#1C5E55" ForeColor="White" Font-Bold="True"></FooterStyle>

<CommandRowStyle BackColor="#C5BBAF" Font-Bold="True"></CommandRowStyle>

<EditRowStyle BackColor="#7C6F57"></EditRowStyle>

<RowStyle BackColor="#E3EAEB"></RowStyle>

<PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center"></PagerStyle>
<Fields>
<asp:BoundField ReadOnly="True" DataField="SprintID" InsertVisible="False" Visible="False" SortExpression="SprintID" HeaderText="ID" ShowHeader="False"></asp:BoundField>
<asp:TemplateField SortExpression="SprintPositive" HeaderText="Sprint Positives"><EditItemTemplate>
<asp:TextBox id="TextBox1" runat="server" Font-Size="X-Small" Font-Names="Verdana" Text='<%# Bind("SprintPositive") %>' Height="108px" __designer:wfdid="w19" Width="600px" TextMode="MultiLine" MaxLength="4000"></asp:TextBox><BR /><asp:CustomValidator id="cvalidRetro" runat="server" ForeColor="LightCoral" ToolTip="4000" __designer:wfdid="w20" OnServerValidate="CustValMLMaxLength_ServerValidate" ErrorMessage="* Only 4000 chars allowed." ControlToValidate="TextBox1"></asp:CustomValidator> 
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox id="TextBox1" runat="server" Text='<%# Bind("SprintPositive") %>' __designer:wfdid="w21"></asp:TextBox> 
</InsertItemTemplate>

<ItemStyle Width="600px" Wrap="True" HorizontalAlign="Left" VerticalAlign="Top"></ItemStyle>

<HeaderStyle Width="160px" HorizontalAlign="Left" VerticalAlign="Top"></HeaderStyle>
<ItemTemplate>
<asp:Label id="Label1" runat="server" Font-Size="X-Small" Text='<%# Bind("SprintPositive", "{0}") %>' __designer:wfdid="w18"></asp:Label> 
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField SortExpression="SprintNegative" HeaderText="Sprint Negatives"><EditItemTemplate>
<asp:TextBox id="TextBox2" runat="server" Font-Size="X-Small" Font-Names="Verdana" Text='<%# Bind("SprintNegative") %>' Height="108px" __designer:wfdid="w15" Width="600px" TextMode="MultiLine" MaxLength="4000"></asp:TextBox><BR /><asp:CustomValidator id="cvalidRetro2" runat="server" ForeColor="LightCoral" ToolTip="4000" __designer:wfdid="w16" OnServerValidate="CustValMLMaxLength_ServerValidate" ErrorMessage="* Only 4000 chars allowed." ControlToValidate="TextBox2"></asp:CustomValidator> 
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox id="TextBox2" runat="server" Text='<%# Bind("SprintNegative") %>' __designer:wfdid="w17"></asp:TextBox> 
</InsertItemTemplate>

<ItemStyle Width="600px" HorizontalAlign="Left" VerticalAlign="Top"></ItemStyle>

<HeaderStyle Width="160px" HorizontalAlign="Left" VerticalAlign="Top"></HeaderStyle>
<ItemTemplate>
<asp:Label id="Label2" runat="server" Text='<%# Bind("SprintNegative") %>' __designer:wfdid="w14"></asp:Label> 
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField SortExpression="SprintChanges" HeaderText="Changes for Next Sprint"><EditItemTemplate>
<asp:TextBox id="TextBox3" runat="server" Font-Size="X-Small" Font-Names="Verdana" Text='<%# Bind("SprintChanges") %>' Height="108px" __designer:wfdid="w11" Width="600px" TextMode="MultiLine" MaxLength="4000"></asp:TextBox><BR /><asp:CustomValidator id="cvalidRetro3" runat="server" ForeColor="LightCoral" ToolTip="4000" __designer:wfdid="w12" OnServerValidate="CustValMLMaxLength_ServerValidate" ErrorMessage="* Only 4000 chars allowed." ControlToValidate="TextBox3"></asp:CustomValidator> 
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox id="TextBox3" runat="server" Text='<%# Bind("SprintChanges") %>' __designer:wfdid="w13"></asp:TextBox> 
</InsertItemTemplate>

<ItemStyle Width="600px" HorizontalAlign="Left" VerticalAlign="Top"></ItemStyle>

<HeaderStyle Width="160px" HorizontalAlign="Left" VerticalAlign="Top"></HeaderStyle>
<ItemTemplate>
<asp:Label id="Label3" runat="server" Text='<%# Bind("SprintChanges") %>' __designer:wfdid="w10"></asp:Label> 
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField ReadOnly="True" DataField="SprintRetrospectiveNotesID" InsertVisible="False" Visible="False" SortExpression="SprintRetrospectiveNotesID" HeaderText="SprintRetrospectiveNotesID"></asp:BoundField>
<asp:CommandField ShowEditButton="True"></asp:CommandField>
</Fields>

<FieldHeaderStyle BackColor="#D0D0D0" Font-Bold="True"></FieldHeaderStyle>

<HeaderStyle BackColor="#1C5E55" ForeColor="White" Font-Bold="True"></HeaderStyle>

<AlternatingRowStyle BackColor="White"></AlternatingRowStyle>
</asp:DetailsView> </TD></TR></TBODY></TABLE>
</ContentTemplate>
    </asp:UpdatePanel>
    <asp:SqlDataSource ID="dsRetrospectiveNotes" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
        InsertCommand="INSERT INTO tblSprintRetrospectiveNotes (SprintPositive, SprintNegative, SprintChanges) VALUES (@SprintPositive, @SprintNegative, @SprintChanges)&#13;&#10;"
        SelectCommand="SELECT tblSprint.SprintID, tblSprintRetrospectiveNotes.SprintPositive, tblSprintRetrospectiveNotes.SprintNegative, tblSprintRetrospectiveNotes.SprintChanges, tblSprintRetrospectiveNotes.SprintRetrospectiveNotesID FROM tblSprint INNER JOIN tblSprintRetrospectiveNotes ON tblSprint.fSprintRetrospectiveNotesID = tblSprintRetrospectiveNotes.SprintRetrospectiveNotesID INNER JOIN tblMasterBacklogSchedule ON tblSprint.fMasterBacklogScheduleID = tblMasterBacklogSchedule.MasterBacklogScheduleID WHERE (tblSprint.SprintID = @SprintID) AND (tblMasterBacklogSchedule.fScrumTeamID = @ScrumTeamID)"
        UpdateCommand="UPDATE tblSprintRetrospectiveNotes SET SprintPositive = @SprintPositive, SprintNegative = @SprintNegative, SprintChanges = @SprintChanges WHERE (SprintRetrospectiveNotesID = @original_SprintRetrospectiveNotesID)"
        OldValuesParameterFormatString="original_{0}">
        <UpdateParameters>
            <asp:Parameter Name="SprintPositive" />
            <asp:Parameter Name="SprintNegative" />
            <asp:Parameter Name="SprintChanges" />
            <asp:Parameter Name="original_SprintRetrospectiveNotesID" />
        </UpdateParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="ddSprintNames" Name="SprintID" PropertyName="SelectedValue" />
            <asp:SessionParameter Name="ScrumTeamID" SessionField="ScrumTeamID" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="SprintPositive" />
            <asp:Parameter Name="SprintNegative" />
            <asp:Parameter Name="SprintChanges" />
        </InsertParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="dsSprintNames" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
        SelectCommand="SELECT tblSprint.SprintID, tblMasterBacklogSchedule.SprintName FROM tblMasterBacklogSchedule INNER JOIN tblSprint ON tblMasterBacklogSchedule.MasterBacklogScheduleID = tblSprint.fMasterBacklogScheduleID WHERE (tblMasterBacklogSchedule.fScrumTeamID = @ScrumTeamID) ORDER BY tblMasterBacklogSchedule.EndDate DESC">
        <SelectParameters>
            <asp:SessionParameter Name="ScrumTeamID" SessionField="ScrumTeamID" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>
